<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <style>
         .box{
            height: 300px;
            background: rgb(158, 105, 255);
        }
        .box1{
            height: 500px;
            background: hotpink;
        }
        .box2{
            width: 500px;
           
        }
    </style>
</head>
<body>
    <div id="app">
        <div :class='boxClo'></div>
      <button @click='change'> 修改</button>
    </div>
    <script>
        const vm =new Vue({
            el:'#app',
            data:{
                boxClo:{
                    box:true,
                    box1:false,
                    box2:true,
                }
            },
            methods:{
                change(){
                    this.boxClo.box=!this.boxClo.box
                    this.boxClo.box1=!this.boxClo.box1
                    this.boxClo.box2=!this.boxClo.box2
                }
                
            }
        })
    </script>
</body>
</html>